<!DOCTYPE html>
<html lang="zh-cmn-Hans">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>订单管理-鹿程智慧油站商户平台</title>
		<meta name="description" content="鹿程科技是提供加油站互联网化零管系统、营销及支付和大数据分析运营服务的行业领先科技公司。鹿程科技充分了解加油站行业的需求和新兴互联网的发展,依靠业内最先进的科技和标准化的运营,持续帮助油站业务发展创造价值。"/>
		<meta name="keywords" content="智慧油站,鹿程,鹿程智慧油站,鹿程智慧油站微信支付,加油站微信支付,加油站营销管理"/>
		<link rel="icon" href="https://static.zhihuiyouzhan.com.cn/static/styles/admin/img/title.ico" type="image/x-icon">
		<link rel="shortcut icon" href="https://static.zhihuiyouzhan.com.cn/static/styles/admin/img/title.ico" type="image/x-icon">
		<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
		<link rel="stylesheet" href="../layui/css/layui.css" />
		<link rel="stylesheet" href="../css/style.css" />
	</head>
<body>
	<section class="section-right">
		<!--deer-tit-->
		<div class="deer-tit">
			<h3>便利店</h3>
			<h4>销售订单</h4>
			<h5 class="ware-link"><a name="">添加商品</a></h5>
		</div>
		<!--/deer-tit-->
		<!--deer-content-->
		<div class="deer-content">
			<table class="layui-table" lay-skin="line">
			  	<thead>
				    <tr>
				      	<th>ID</th>
				        <th>名称</th>
				        <th>分类</th>
				        <th>市场售价</th>
				        <th>库存</th>
				        <th>虚拟销量</th>
				        <th>创建时间</th>
				        <th>是否上架</th>
				        <th>操作</th>
				    </tr> 
			  	</thead>
			  	<tbody>
			  		<tr>
			  			<td>25</td>
			  			<td>水果</td>
			  			<td>水果小吃</td>
			  			<td>1</td>
			  			<td>1</td>
			  			<td>1</td>
			  			<td>2018-02-01 21:22:00</td>
			  			<td>
			  				<button class="ware-btn" onclick="goodsEnd()"><i class="fa fa-check ware-fa-check"></i></button>
			  			</td>
			  			<td>
			  				<button class="ware-btn ware-operate"><i class="fa fa-pencil-square-o ware-fa-green"></i></button>
			  			</td>
			  		</tr>
			  		<tr>
			  			<td>25</td>
			  			<td>水果</td>
			  			<td>水果小吃</td>
			  			<td>1</td>
			  			<td>1</td>
			  			<td>1</td>
			  			<td>2018-02-01 21:22:00</td>
			  			<td>
			  				<button class="ware-btn" onclick="goodsStart()"><i class="fa fa-times ware-fa-croci"></i></button>
			  			</td>
			  			<td>
			  				<button class="ware-btn ware-operate"><i class="fa fa-pencil-square-o ware-fa-green"></i></button>
			  			</td>
			  		</tr>
			  	</tbody>
			</table>
		</div>
		<!--/deer-content-->
	</section>
	
	
	
	<!--js-->
	<aside>
		<script type="text/javascript" src="../layui/layui.js" ></script>
		<script type="text/javascript">
			
			layui.use(['layer','jquery','element'],function(){
				var	layer=layui.layer;
				var $=layui.jquery;
				var element=layui.element;
				
				window.goodsEnd=function(){
					layer.confirm('你是否要下架商品？',{
						btn:['下架','取消']
					},function(){
						//确认下架后执行的函数
							$.ajax({
								url : "/merchant/shop/offView",
								type : 'post',
								data : {
									'id' : res
								},
								datatype : 'json',
								success : function(res) {
									if (res.code == 0) {
										
										window.location.reload();
									}
								}
							})
						layer.msg('商品下架成功', {icon: 1})
					},function(){
						//确认不下架后执行的函数
						layer.msg('您已经取消了操作', {icon: 0})
					}
					)
				}
				
				window.goodsStart=function(){
					layer.confirm('你是否要上架商品？',{
						btn:['上架','取消']
					},function(){
						//确认上架后执行的函数
						$.ajax({
							url : "/merchant/shop/noView",
							type : 'post',
							data : {
								'id' : res
							},
							datatype : 'json',
							success : function(res) {
								if (res.code == 0) {
									window.location.reload();
								}
							}
						})
						layer.msg('商品上架成功', {icon: 1})
					},function(){
						//确认不上架后执行的函数
						layer.msg('您已经取消了操作', {icon: 0})
						}
					)
				}
				
				$('.ware-operate').bind('click',function(){
					var $id=$('.ware-link a').attr('name')
					layer.open({
						title:"添加商品",
						shadeClose: true,
					    type: 2,
					    offset: ['150px', '25%'],
					    area: ['50%', '700px'],
					    content:'便利店-商品管理-添加商品.html',
			            end:function () {
			                location.reload();
			            }
					})
					console.log('id')

				})
				
			})
				
		</script>
		
		
		
	</aside>
	<!--/js-->
</body>
</html>